package com.demo.wormhole.autoconfiguration.fegin;

import com.demo.wormhole.component.fegin.interceptor.WormholeFeignRequestInterceptor;
import feign.RequestInterceptor;
import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
@ConditionalOnClass(RequestInterceptor.class)
public class WormholeFeginAutoConfiguration {
    
    @ConditionalOnClass(WormholeFeignRequestInterceptor.class)
    @Bean
    public RequestInterceptor wormholeFeignRequestInterceptor() {
        return new WormholeFeignRequestInterceptor();
    }
}
